package com.jj.core.client;

import com.jj.aop.annotation.RPC;
import com.jj.message.battle.UserMessage;
import com.jj.net.kcp.KcpState;

/**
 * Copyrights: QidianGroup@JJ
 *
 * @author: LuHan
 * @date: 2018/1/15, 13:44
 */
public interface MsgBuilder {
    //RPC底层会根据request msgid +1 来设置response msgid
    @RPC(id=-1, args = {"code"})
    UserMessage onCode(Integer code);

    @RPC(id=-1)
    UserMessage onReturn(Object retObj);

    // id = 0, default generic RPC call
    @RPC
    UserMessage onGenericCall(Object retValue);

    @RPC(id=2, args = {"code","msg","uid","nickName","icon","kcpState"})
    UserMessage onLogonResponse(Integer code, String msg,
                                Long uid, String nickName, Integer icon, KcpState kcpState);

    @RPC(id=4, args = {"code", "isCaptain","conv","host","port"})
    UserMessage onJoinResponse(Integer code, Boolean isCaptain, Integer conv, String host, Integer port);

    @RPC(id=6, args = {"code", "reason"})
    UserMessage onLeaveResponse(Integer code, Integer reson);
}
